<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>优惠券详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">

    <link rel="stylesheet" href="../../css/weadmin.css">
    <link rel="stylesheet" href="../../css/init.css">
    <link rel="stylesheet" href="../../plugs/layui/css/layui.css">

</head>

<body>

    <div class="weadmin-body">
        <form class="layui-form" lay-filter="couponDetailForm">

            <div class="bw-panel">
                <blockquote class="layui-elem-quote marBot0">优惠劵信息</blockquote>
                <div class="bw-panel-content">
                    <div class="layui-form-item">
                        <div class="layui-inline layui-col-lg3">
                            <label class="layui-form-label">模板名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="CouponTempName" lay-verify="required" autocomplete="off"
                                    class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline layui-col-lg8">
                            <label class="layui-form-label">品类规则</label>
                            <div class="layui-input-inline">
                                <select name="ServiceType" style="width: 30px;">
                                    <option value="0">不限</option>
                                    <option value="1">拼车</option>
                                    <option value="2">专车</option>
                                </select>
                            </div>
                            <div class="layui-input-block layui-clear" id="tripTypeBox">
                                <input type="checkbox" name="TripType" title="不限" lay-skin="primary" value="0"
                                    lay-filter="TripType" />
                                <input type="checkbox" name="TripType" title="接机" lay-skin="primary" value="1"
                                    lay-filter="TripType" />
                                <input type="checkbox" name="TripType" title="送机" lay-skin="primary" value="2"
                                    lay-filter="TripType" />
                                <input type="checkbox" name="TripType" title="接站" lay-skin="primary" value="3"
                                    lay-filter="TripType" />
                                <input type="checkbox" name="TripType" title="送站" lay-skin="primary" value="4"
                                    lay-filter="TripType" />
                                <input type="checkbox" name="TripType" title="市内预约" lay-skin="primary" value="5"
                                    lay-filter="TripType" />
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">金额规则</label>
                            <div class="layui-input-block">
                                <select name="RuleType" lay-filter="CouponRule">
                                    <option value="1" selected>满减</option>
                                    <option value="2">立减</option>
                                    <option value="3">折扣</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline" id="CouponRuleInputBox"></div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">计算金额</label>
                            <div class="layui-input-block">
                                <select name="CalculateAmountType">
                                    <option value="1">实际支付金额</option>
                                    <option value="2">订单金额</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">有效期</label>
                            <div class="layui-input-block">
                                <select name="IndateType" lay-filter="CouponIndate">
                                    <option value="0" selected>不限</option>
                                    <option value="1">固定日期</option>
                                    <option value="2">固定天数</option>
                                    <option value="3">时间范围</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline" id="CouponIndateBox" style="margin-bottom:0;"></div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">城市限制</label>
                            <div class="layui-input-block" id="multipleCityBox">
                                <select multiple="multiple" id="multipleCity">
                                    <option value="">不限</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item" id="subminBtnBox">
                <input type="hidden" id="CouponIdHid" name="CouponId" />
                <div class="layui-input-inline">
                    <button class="layui-btn" lay-submit lay-filter="addCouponBtn">保存</button>
                </div>
            </div>

        </form>
    </div>


    <script type="text/html" id="addCouponBar">
        <a class="layui-btn" lay-event="del">添加优惠券</a>
    </script>

    <script type="text/html" id="tpl_CouponRuleInputBox">
        {{ if(it===1){ }}
            <label class="layui-form-label">满减设置</label>
            <div class="layui-input-block">
                <label>满</label>
                <input type="text" name="SatisfyAmount" autocomplete="off" class="layui-input" lay-verify="required|number"
                    style="display: inline-block; width:inherit;">
                <label>减</label>
                <input type="text" name="CreditAmount" autocomplete="off" class="layui-input" lay-verify="required|number"
                    style="display: inline-block; width:inherit;">
            </div>
        {{ } else if(it===2){ }}
            <label class="layui-form-label">立减设置</label>
            <div class="layui-input-block">
                <label>减</label>
                <input type="text" name="CreditAmount" autocomplete="off" class="layui-input" lay-verify="required|number"
                    style="display: inline-block; width:inherit;">
            </div>
        {{ }else if(it===3) { }}
            <label class="layui-form-label">折扣设置</label>
            <div class="layui-input-block">                
                <input type="text" name="Discount" autocomplete="off" class="layui-input" lay-verify="required|number|Discount"
                    style="display: inline-block; width:inherit;">
                <label>折，上限</label>
                <input type="text" name="DiscountUpperLimit" autocomplete="off" class="layui-input" lay-verify="DiscountUpperLimit"
                    style="display: inline-block; width:inherit;">
                    <label class="grayHint">不填代表无上限</label>
            </div>
        {{ }  }}
    </script>

    <script type="text/html" id="tpl_CouponIndateBox">
        {{ if(it===1){ }}
            <div class="layui-inline">
                <input type="text" name="IndateDateTime" autocomplete="off" 
                    class="layui-input layui-date-input" lay-verify="required" readonly="readonly">
            </div>
            <div class="layui-inline">
                <label class="grayHint">到期</label>                
            </div>
        {{ }else if(it===2){ }}
            <div class="layui-inline">
                <input type="text" name="IndataDay" autocomplete="off" class="layui-input" lay-verify="required|number" >
            </div>
            <div class="layui-inline">
                <label class="grayHint">天后到期</label>
            </div>
        {{ } else if(it===3){ }}
            <div class="layui-inline">
                <input type="text" name="IndateDateTime" autocomplete="off" class="layui-input layui-date-input"  readonly="readonly" >
            </div>
            <div class="layui-inline">
                <label class="grayHint">到期</label>
            </div>
        {{ } }}


    </script>

    <script type="text/javascript" src="../../js/init.js"></script>
    <script src="https://cdn.bootcss.com/dot/1.1.2/doT.js"></script>

</body>

</html>